import service from '@/api/request.js'

// 根据日期获取当天的填写记录
export function getDetailByDayApi(day) {
  return service({
    url: '/logs/content/getLogByDay?day=' + day,
    method: 'get'
  })
}
// 新增工作日志
export function addContentApi(data) {
  return service({
    url: '/logs/content',
    method: 'post',
    data: data
  })
}

// 修改工作日志
export function updateContentApi(data) {
  return service({
    url: '/logs/content',
    method: 'put',
    data: data
  })
}
// 获取我的未录日志
export function listMyLogsApi(params) {
  return service({
    url: '/logs/content/listMyLogs',
    method: 'get',
    params: params
  })
}
// 获取我的已录日志
export function myCompleteLogsApi(params) {
  return service({
    url: '/logs/content/list',
    method: 'get',
    params: params
  })
}
// 日志个人统计
export function getCountByTimeApi(params) {
  return service({
    url: '/logs/count/getCountByTime',
    method: 'get',
    params: params
  })
}
// 部门统计日志
export function getCountByOneDeptApi(params) {
  return service({
    url: '/logs/count/getCountByOneDept',
    method: 'get',
    params: params
  })
}
// 部门统计日志(正常录入
export function byNormalApi(params) {
  return service({
    url: '/logs/content/byNormal',
    method: 'get',
    params: params
  })
}
// 部门统计日志(补录
export function byPostponeApi(params) {
  return service({
    url: '/logs/content/byPostpone',
    method: 'get',
    params: params
  })
}
// 部门统计日志(未完成
export function byUncompletedApi(params) {
  return service({
    url: '/logs/content/byUncompleted',
    method: 'get',
    params: params
  })
}
// 删除日记
export function delLogsApi(id) {
  return service({
    url: `/logs/content/${id}`,
    method: 'delete',
  })
}
// 获取假期列表
export function holidaysApi() {
  return service({
    url: `/logs/logsDay/list`,
    method: 'get',
  })
}
// 根据userId StartTime endTime 查询已录日记列表
export function getAllByTime(params) {
  return service({
    url: `/logs/content/getAllByTime`,
    method: 'get',
    params,
  })
}
